package com.example.deptempmanageservice.service;

import com.example.deptempmanageservice.dao.EmployeeMapper;
import com.myprojects.common.pojo.Employee;
import com.myprojects.common.pojo.EmployeeExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmployeeService {

    @Autowired
    EmployeeMapper employeeMapper;

    public long countByExample(EmployeeExample example){
        return employeeMapper.countByExample(example);
    }

    public int deleteLotsByPrimaryKey(List<Integer> idList) {
        return employeeMapper.deleteLotsByPrimaryKey(idList);
    }

    public int insertSelective(Employee record){
        return employeeMapper.insertSelective(record);
    }

//    /**
//     * 该方法用于通过条件来查询实习员工
//     */
//    public List<Employee> selectInternshipByExample(EmployeeExample example){
//        example.createCriteria().andStatusEqualTo((byte) 101);
//        return employeeMapper.selectByExample(example);
//    }

    public List<Employee> selectByExample(EmployeeExample example){
        return employeeMapper.selectByExample(example);
    }


    public Employee selectByPrimaryKey(Integer id){
        return employeeMapper.selectByPrimaryKey(id);
    }

    public int updateByPrimaryKeySelective(Employee record) {
        return employeeMapper.updateByPrimaryKeySelective(record);
    }

}
